Hello everyone. First I would thank you all, I've found so much help on this forum ! Today I have an upper module (covered module), this module contains some requirements that don't need to be refined in the lower module. To avoid users to copy/paste from the upper module to the lower module, I'm developing a dxl script. To do that, I've added an attribute called "DirectFlowDown" (Yes or No values). Then for all objects (in the lower module), if "DirectFlowDown" is "True", the script search the upper object (previously linked by the user) on the upper module then copy/paste the text in the current module (lower module). I hope it is clear :) The problem is I want to refresh the lower module by using this script (with maybe some modification) in two cases:
Any help is welcome !! Thanks in advance. Joooris - Tue Jan 24 03:47:36 EST 2017 |
Re: Mirror Requirement This use case, you normally would handle with a DXL attribute in DOORS. This way the data would always be in sync. Is there a specific reason, you would want the duplication of data? Regards, Mathias |
Re: Mirror Requirement Mathias Mamsch - Tue Jan 24 08:29:47 EST 2017 This use case, you normally would handle with a DXL attribute in DOORS. This way the data would always be in sync. Is there a specific reason, you would want the duplication of data? Regards, Mathias Hi thanks for your answer :)
This use case, you normally would handle with a DXL attribute in DOORS. This way the data would always be in sync. How can I handle this use case with just an attribute?
Is there a specific reason, you would want the duplication of data? For instance module A has two requirements a1 and a2. There is module B which covers module A. In module B we refine requirements of module A, but a2 doesn't need to be refined. So we will have b1 and b2 that refine a1, and b3 which is just a copy of a2. I would like b3 requirement to always be "equals" to a2 requirement. |
Re: Mirror Requirement Joooris - Tue Jan 24 10:36:59 EST 2017 Hi thanks for your answer :)
This use case, you normally would handle with a DXL attribute in DOORS. This way the data would always be in sync. How can I handle this use case with just an attribute?
Is there a specific reason, you would want the duplication of data? For instance module A has two requirements a1 and a2. There is module B which covers module A. In module B we refine requirements of module A, but a2 doesn't need to be refined. So we will have b1 and b2 that refine a1, and b3 which is just a copy of a2. I would like b3 requirement to always be "equals" to a2 requirement. I guess you would have a certain kind of "Mirror" objects inside the module, but that does not necessarily mean, that you need to copy the attribute content. You could make inside module B an object with a link to the object in module A. Inside the Object Text you put a disclaimer " --- unrefined requirement - do not edit --- ", you make an "Object Type" attribute, which says "Unrefined Requirement" or something like that, and you make a DXL attribute with the following logic: - if the "Object Type" == "Unrefined Requirement" -> show text of linked requirement - if the "Object Type" is something else: Show my "Object Text" attribute This way, you have the DXL attribute where you can read the whole requirements. It will automatically update on changes to the parent module. When you edit the object text of an "unrefined requirement", this change will be ignored. The drawback is, you have a set of attributes to "read" and a different set of attributes to write to. The big (very big!) advantage is, that you do not need to care about synchronizing modules and inconsistent requirements anymore. Regards, Mathias |
Re: Mirror Requirement Hi, Thanks It works. I've first tested to define only one attribute "CopyReq_DXLattribute" which uses an enumerate (Yes, No) and was declared as a DXL attribute, then the DXL script tests obj.attrDXLName (equal to obj."CopyReq_DXLattribute") => Doors CRASHED :) Also, the module was corrupted
Then I did it with 2 attributes. I have "CopyReq" which uses enumerate attribut (Yes, No) and "CopyReq_DXLattribute" which contains the script. When opening the module, "CopyReq_DXLattribute" reads "CopyReq" :
It works well, but it can not be refreshed automatically in the case someone modifies the upper requirement. I mean, without opening it. Any idea? |
Re: Mirror Requirement Joooris - Wed Jan 25 11:49:03 EST 2017 Hi, Thanks It works. I've first tested to define only one attribute "CopyReq_DXLattribute" which uses an enumerate (Yes, No) and was declared as a DXL attribute, then the DXL script tests obj.attrDXLName (equal to obj."CopyReq_DXLattribute") => Doors CRASHED :) Also, the module was corrupted
Then I did it with 2 attributes. I have "CopyReq" which uses enumerate attribut (Yes, No) and "CopyReq_DXLattribute" which contains the script. When opening the module, "CopyReq_DXLattribute" reads "CopyReq" :
It works well, but it can not be refreshed automatically in the case someone modifies the upper requirement. I mean, without opening it. Any idea? I think you misunderstood. Your DXL attribute should NOT copy the object text, but simply show the text. Like so:
if (obj."CopyReq_DXLattribute" == "Yes") {
obj.attrDXLName = richText myLinkedRequirement."Object Text";
} else {
obj.attrDXLName = richText obj."Object Text";
}
Your requirement text will then be shown inside the DXL attribute. This will work of course also, when you are only in read mode. DXL attributes recalculate when someone opens the module. You can also force recalculation of all DXL attributes from the menu. Regards, Mathias |
Re: Mirror Requirement Mathias Mamsch - Thu Jan 26 03:46:32 EST 2017 I think you misunderstood. Your DXL attribute should NOT copy the object text, but simply show the text. Like so:
if (obj."CopyReq_DXLattribute" == "Yes") {
obj.attrDXLName = richText myLinkedRequirement."Object Text";
} else {
obj.attrDXLName = richText obj."Object Text";
}
Your requirement text will then be shown inside the DXL attribute. This will work of course also, when you are only in read mode. DXL attributes recalculate when someone opens the module. You can also force recalculation of all DXL attributes from the menu. Regards, Mathias Yes actually this is what I've done. In my mind this operation is like a copy/paste. |
Re: Mirror Requirement Joooris - Thu Jan 26 04:45:02 EST 2017 Yes actually this is what I've done. In my mind this operation is like a copy/paste. Ok, in this case, what do you mean by "but it can not be refreshed automatically"? |
Re: Mirror Requirement Mathias Mamsch - Thu Jan 26 05:17:32 EST 2017 Ok, in this case, what do you mean by "but it can not be refreshed automatically"? Sorry, I found I had a typo in the above post: This should also work in read only mode, since DXL will always recalculate the DXL attribute. Thats why I asked, why you say, that refresh will not work. |
Re: Mirror Requirement It doesn't work in read mode. I had DXL error message to this line obj.attrDXLName = richText myLinkedRequirement."Object Text"; So in this case I raise an error only if the requirement is not up to date (if text of requirements are different) Refresh works well :) |
Re: Mirror Requirement Joooris - Thu Jan 26 07:44:34 EST 2017 It doesn't work in read mode. I had DXL error message to this line obj.attrDXLName = richText myLinkedRequirement."Object Text"; So in this case I raise an error only if the requirement is not up to date (if text of requirements are different) Refresh works well :) There cannot be an error with the above line for a DXL attribute, except if "myLinkedRequirement" is not valid. Please post your complete code. Regards, Mathias |